using System;
using System.Collections;
using System.Collections.Generic;
using Me.Prettyprint.Cassandra.Connection;
using Me.Prettyprint.Cassandra.Service;
using Me.Prettyprint.Hector.Api;
using Me.Prettyprint.Hector.Api.Beans;
using Me.Prettyprint.Hector.Api.Query;

namespace Me.Prettyprint.Cassandra.Model
{
    /// <summary>
    /// Base class for column queries. It requires the keyspace, column name and value.
    /// </summary>
    /// <typeparam name="K"></typeparam>
    /// <typeparam name="N"></typeparam>
    /// <typeparam name="V"></typeparam>
	public abstract class AbstractColumnQuery<K, N, V> : AbstractQuery<K, N, V, HColumn<N, V>>, ColumnQuery<K, N, V>
	{
        protected AbstractColumnQuery(Keyspace k, Serializer<K> keySerializer, Serializer<N> nameSerializer, Serializer<V> valueSerializer) : base(k, keySerializer, nameSerializer, valueSerializer)
        {
        }
        protected K Key
        {
            get;
            set;
        }
        protected N Name
        {
            get;
            set;
        }
        public ColumnQuery<K, N, V> SetKey(K key)
        {
            Key = key;
            return this;
        }
        public ColumnQuery<K, N, V> SetName(N name)
        {
            Name = name;
            return this;
        }
        public new ColumnQuery<K, N, V> SetColumnFamily(string cf) 
        {
            return (ColumnQuery<K, N, V>) base.SetColumnFamily(cf);
        }
        public override string ToString()
        {
            return "AbstractColumnQuery(" + Key + "," + Name + ")";
        }
	}
}